<html>
<head><meta charset="utf-8"><title>Current thoughts on &quot;stuttering&quot; names? · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html">Current thoughts on &quot;stuttering&quot; names?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240229907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240229907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240229907">(May 25 2021 at 18:24)</a>:</h4>
<p>Context: <a href="https://internals.rust-lang.org/t/auto-infer-namespaces-on-struct-and-enum-instantiations/14764/9?u=scottmcm">https://internals.rust-lang.org/t/auto-infer-namespaces-on-struct-and-enum-instantiations/14764/9?u=scottmcm</a></p>
<p>Once upon a time it was the pattern that things be <code>io::Error</code>, not <code>io::IoError</code>.</p>
<p>Is that still suggested?  I'm wondering if thoughts have changed here, and particularly if any of those reasons would also apply to enums.  Like whether <code>enum CookieHandling { Parse, Skip }</code> are considered idomatic, or whether conventions would just suggest that the variants have more understandable-in-isolation names.</p>



<a name="240231031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231031">(May 25 2021 at 18:33)</a>:</h4>
<p>I think our policy is to prefer the former still</p>



<a name="240231076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231076">(May 25 2021 at 18:33)</a>:</h4>
<p>well, I think we actually prefer more sentence like error names most of the time</p>



<a name="240231080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231080">(May 25 2021 at 18:33)</a>:</h4>
<p>like ParseIntError</p>



<a name="240231104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231104">(May 25 2021 at 18:33)</a>:</h4>
<p>VerbNounError</p>



<a name="240231526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231526">(May 25 2021 at 18:37)</a>:</h4>
<p>but yea, I think relying on the enum name to provide context on the meaning of the enum variants is idiomatic personally, unless you put the variants in a prelude directly.</p>



<a name="240231969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240231969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240231969">(May 25 2021 at 18:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240231526">said</a>:</p>
<blockquote>
<p>but yea, I think relying on the enum name to provide context on the meaning of the enum variants is idiomatic personally, unless you put the variants in a prelude directly.</p>
</blockquote>
<p>yes, very strong agree here.</p>
<p>if and when i do something like <code>use foo::bar::EnumName::*;</code>, the scope is almost always tightly constrained, e.g., to a single function with a match block. so the "context" is still not far away in that case, while absolving the need to spell out the full enum.</p>



<a name="240232213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240232213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240232213">(May 25 2021 at 18:42)</a>:</h4>
<p>personally I don't duplicate an enum's name in its variants, if a user wants to glob-import to avoid writing the <code>Foo::</code> then it's reasonable to do so in an inner scope</p>



<a name="240261633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240261633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240261633">(May 25 2021 at 23:08)</a>:</h4>
<p>While the stated policy is still to prefer <code>io::Error</code> over just <code>IoError</code>, in practice a large portion of the standard library doesn't do that, and new things that get added usually do not do that. It's mostly just <code>io</code> and <code>fmt</code> that do that. Personally, I think we should just update the policy to the newer style that we actually do use in practice, because the old policy is ugly anyway.</p>
<p><strong>However</strong>, type name and enum variant name are generally a different question. Most enum handling I see is <code>EnumName::TagName</code>, very rarely is a tag used without the enum it goes with. Like BurntSushi said, usually in very local contexts when "everyone knows" what a particular variant is all about.</p>
<p>"something something <code>Some</code>/<code>None</code> and <code>Ok</code>/<code>Err</code> are outliers  and should not have been counted in the survey".</p>



<a name="240262356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240262356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240262356">(May 25 2021 at 23:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240261633">said</a>:</p>
<blockquote>
<p>While the stated policy is still to prefer <code>io::Error</code> over just <code>IoError</code>, in practice a large portion of the standard library doesn't do that, and new things that get added usually do not do that. It's mostly just <code>io</code> and <code>fmt</code> that do that. Personally, I think we should just update the policy to the newer style that we actually do use in practice, because the old policy is ugly anyway.</p>
<p><strong>However</strong>, type name and enum variant name are generally a different question. Most enum handling I see is <code>EnumName::TagName</code>, very rarely is a tag used without the enum it goes with. Like BurntSushi said, usually in very local contexts when "everyone knows" what a particular variant is all about.</p>
<p>"something something <code>Some</code>/<code>None</code> and <code>Ok</code>/<code>Err</code> are outliers  and should not have been counted in the survey".</p>
</blockquote>
<p>can you give examples of what you mean by other parts of the codebase that don't follow the same style as <code>io::Error</code>?</p>



<a name="240263388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263388">(May 25 2021 at 23:32)</a>:</h4>
<p>I personally do think we should avoid duplication between enum names and their variants; <code>Foo::Thing1</code>, not<code>Foo::Thing1Foo</code> or <code>Foo::FooThing1</code>.</p>



<a name="240263422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263422">(May 25 2021 at 23:33)</a>:</h4>
<p>And I similarly think we should avoid duplication between modules and items in those modules. <code>foo::func</code> and <code>foo::ThingError</code>, not <code>foo::foo_func</code> and <code>foo::FooThingError</code>.</p>



<a name="240263481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263481">(May 25 2021 at 23:34)</a>:</h4>
<p>The one exception to that: I don't think it's a good practice to shadow well-known names. So, <code>foo::ThingError</code>or <code>foo::thing::ThingError</code>, not <code>foo::Error</code> or <code>foo::thing::Error</code>.</p>



<a name="240263494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263494">(May 25 2021 at 23:34)</a>:</h4>
<p>I think <code>io::Write</code> and <code>fmt::Write</code> was a mistake.</p>



<a name="240263605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263605">(May 25 2021 at 23:36)</a>:</h4>
<p>(Side note, I think we should find a better description than "stuttering", since that's a thing some people have to deal with. Perhaps "redundant" names?)</p>



<a name="240263635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240263635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240263635">(May 25 2021 at 23:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240263422">said</a>:</p>
<blockquote>
<p>And I similarly think we should avoid duplication between modules and items in those modules. <code>foo::func</code> and <code>foo::ThingError</code>, not <code>foo::foo_func</code> and <code>foo::FooThingError</code>.</p>
</blockquote>
<p>this is the one I bet causes most of the issues</p>



<a name="240266517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240266517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240266517">(May 26 2021 at 00:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240262356">said</a>:</p>
<blockquote>
<p>can you give examples of what you mean by other parts of the codebase that don't follow the same style as <code>io::Error</code>?</p>
</blockquote>
<p>Yeah, uh, nearly every error type outside of io and fmt. NulError, VarError, ErrorKind, NoneError, RecvError, SendError, Utf8Error, AllocError, probably more but that seems like enough examples.</p>
<p>And, yes, (some of) these don't repeat a module path within their name, but that brings me to my next point:</p>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240263422">said</a>:</p>
<blockquote>
<p>And I similarly think we should avoid duplication between modules and items in those modules. <code>foo::func</code> and <code>foo::ThingError</code>, not <code>foo::foo_func</code> and <code>foo::FooThingError</code>.</p>
</blockquote>
<p>The module that a funciton lives in shouldn't really affect the name at all. The names of all your stuff should make sense even if they exist in a totally flat namespace. Then you can just pretty much fully import everything, and it doesn't have a lot of clashes, and it reads well too.</p>



<a name="240278108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278108">(May 26 2021 at 04:18)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> I don't think that's true in general. Otherwise, <code>std::env::vars</code> should be called <code>std::env::env_vars</code>, for instance.</p>



<a name="240278128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278128">(May 26 2021 at 04:19)</a>:</h4>
<p>And <code>std::path::is_separator</code> would need to be called <code>is_path_separator</code> or similar.</p>



<a name="240278135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278135">(May 26 2021 at 04:20)</a>:</h4>
<p>I'm sure there are many other examples.</p>



<a name="240278174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278174">(May 26 2021 at 04:20)</a>:</h4>
<p>But I agree with both of those things ;P</p>



<a name="240278272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278272">(May 26 2021 at 04:23)</a>:</h4>
<p>That would be quite inconsistent with our existing practice, and with existing practice in many other languages with module systems.</p>



<a name="240278472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278472">(May 26 2021 at 04:27)</a>:</h4>
<p>i think "slightly" is a better adverb there.</p>



<a name="240278543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240278543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240278543">(May 26 2021 at 04:28)</a>:</h4>
<p>and i won't speak to all languages, but i'll note that <code>isPathSeparator</code> is a function in Haskell, which has a module system</p>



<a name="240279458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240279458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240279458">(May 26 2021 at 04:46)</a>:</h4>
<p>I don't think we need to rename every old thing, but I absolutely think that new additions should prefer being named so that they don't need to be module prefixed.</p>



<a name="240294420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240294420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240294420">(May 26 2021 at 08:49)</a>:</h4>
<p>I think in general that would produce suboptimal names.</p>



<a name="240319544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240319544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240319544">(May 26 2021 at 12:57)</a>:</h4>
<p>Can you give an example of a name that would be forced to be sub-optimal <em>when used fully imported</em>?</p>
<p>Because if the block of <code>use</code> junk at the top of a file is like some tiny portion "less optimal" that's really not a huge deal in practice.</p>



<a name="240319687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240319687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240319687">(May 26 2021 at 12:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240294420">said</a>:</p>
<blockquote>
<p>I think in general that would produce suboptimal names.</p>
</blockquote>
<p>yeah, i agree. </p>
<p>i think this is one of those things where it is difficult to establish a simple, succinct and universal rule to follow. for me personally, the thing i strive for is, "reduce redundancy in the names of things with respect to their full absolute path." and moreover, i think it is appropriate to define things in a way where the module name is part of the context of its use. <code>path::is_separator</code> is a good example of that. i like that much better than <code>is_path_separator</code>.</p>
<p>and i think "sub-optimal when used fully imported" is not the only standard by which to judge names. names can be sub-optimal in other ways, like, when not fully imported.</p>



<a name="240402263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240402263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240402263">(May 26 2021 at 22:57)</a>:</h4>
<p>Of course it's not the only standard.</p>



<a name="240402489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240402489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240402489">(May 26 2021 at 23:00)</a>:</h4>
<p>However, if my approach would so clearly produce sub-optimal names, I would like to know what you think those sub-optimal names produced actually are.</p>



<a name="240424126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240424126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240424126">(May 27 2021 at 06:14)</a>:</h4>
<p>i think the "make everything work when fully imported" convention leads to the "smurf naming" problem</p>



<a name="240433826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240433826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kestrer <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240433826">(May 27 2021 at 08:22)</a>:</h4>
<p>Iterators pretty consistently use the <code>io::Error</code> style, e.g. <code>std::collections::binary_heap::{Drain, DrainSorted, IntoIter, IntoIterSorted, Iter}</code>. In addition all of the types in <code>std::collections::{collection name}</code> follow this pattern, like <code>hash_map::Entry</code>.<br>
One notable module that uses the <code>IoError</code> style is <code>std::sync::atomic</code>. I think that was a mistake, because it results in imports like <code>use std::sync::atomic::{self, AtomicU32, AtomicUsize, AtomicBool}</code>, where if it used the other method it could simply be <code>use std::sync::atomic;</code> and <code>atomic::{U32, Usize, Bool}</code>.</p>



<a name="240453064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240453064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240453064">(May 27 2021 at 11:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240402489">said</a>:</p>
<blockquote>
<p>However, if my approach would so clearly produce sub-optimal names, I would like to know what you think those sub-optimal names produced actually are.</p>
</blockquote>
<p>i think josh did that already.</p>



<a name="240472045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240472045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240472045">(May 27 2021 at 14:03)</a>:</h4>
<p>Actually Josh didn't post anything in the thread since I asked the question, so clearly that is incorrect. but whatever. Kestrer was much more helpful.</p>



<a name="240472362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240472362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240472362">(May 27 2021 at 14:05)</a>:</h4>
<p>The biggest problem with module prefixed names is that tooling generally doesn't get it right as to when a type or function is "supposed" to be known about in a partly prefixed way.</p>



<a name="240472894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240472894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240472894">(May 27 2021 at 14:08)</a>:</h4>
<p>josh brought up <code>path::is_separator</code> (which i repeated) and also <code>std::env::vars</code>.</p>



<a name="240472994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240472994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240472994">(May 27 2021 at 14:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240472362">said</a>:</p>
<blockquote>
<p>The biggest problem with module prefixed names is that tooling generally doesn't get it right as to when a type or function is "supposed" to be known about in a partly prefixed way.</p>
</blockquote>
<p>i either haven't experienced this or don't understand it. could you please give an example?</p>



<a name="240474557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240474557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240474557">(May 27 2021 at 14:19)</a>:</h4>
<p>Oh, I agree with that. A big example is stuff like rust-analyzer's auto-import feature.</p>



<a name="240474947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240474947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240474947">(May 27 2021 at 14:22)</a>:</h4>
<p>it imports the name fully, rather than partially — it doesn't (and likely can't without a pile of dodgy heuristics) really know when a path is better with a partial import or a full import.</p>



<a name="240480812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240480812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240480812">(May 27 2021 at 14:59)</a>:</h4>
<p>If you write <code>fn f() -&gt; fmt::Error&lt;|&gt;</code>, rust-analyzer should suggest autoimporting <code>std::fmt</code>. It doesn't do that at the moment, but that's a bug, no need to work around that by changing how things should be named.</p>



<a name="240481085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240481085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240481085">(May 27 2021 at 15:01)</a>:</h4>
<blockquote>
<p>josh brought up <code>path::is_separator</code> (which i repeated) and also <code>std::env::vars</code>.</p>
</blockquote>
<p>Yes, I saw that, and then after I saw that example I asked a follow-up question that was more specifically worded. But, instead of an answer to my more specific question, I got a denial that the question was useful at all, which I found to be not helpful.</p>



<a name="240481349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240481349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240481349">(May 27 2021 at 15:02)</a>:</h4>
<p>In addition to what Thom said, rustdoc also does not magically know when to module-prefix things.</p>



<a name="240482595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240482595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240482595">(May 27 2021 at 15:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240481085">said</a>:</p>
<blockquote>
<blockquote>
<p>josh brought up <code>path::is_separator</code> (which i repeated) and also <code>std::env::vars</code>.</p>
</blockquote>
<p>Yes, I saw that, and then after I saw that example I asked a follow-up question that was more specifically worded. But, instead of an answer to my more specific question, I got a denial that the question was useful at all, which I found to be not helpful.</p>
</blockquote>
<p>i didn't deny it. i said that i don't think it's the only standard. you agreed. so now i don't know where we are in the conversation, and yes, i agree, it is getting frustrating.</p>
<p>in my comment above ("i think this is one of those things ..."), i did my best to give my general stance on this issue. if you'd like to reset, then i might suggest taking it from there.</p>



<a name="240482723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240482723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240482723">(May 27 2021 at 15:10)</a>:</h4>
<blockquote>
<p>If you write fn f() -&gt; fmt::Error&lt;|&gt;, rust-analyzer should suggest autoimporting std::fmt. It doesn't do that at the moment, but that's a bug, no need to work around that by changing how things should be named.</p>
</blockquote>
<p>If i type std::fmt::Error though, it will suggest importing the whole thing. This will IIRC also happen on the autocomplete if I do <code>std::fmt::Err&lt;|&gt;</code> and tabcomplete.</p>



<a name="240482849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240482849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240482849">(May 27 2021 at 15:11)</a>:</h4>
<p>i will also say that, more generally, i don't think the tooling shortcomings i've seen is a good enough reason to change our naming strategy.</p>



<a name="240483016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240483016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240483016">(May 27 2021 at 15:12)</a>:</h4>
<p>for rustdoc, i do things like <code>[module::Foo](Foo)</code> or whatever when i think the module name should be included for appropriate context. (which is sometimes, but not always.)</p>



<a name="240483177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240483177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240483177">(May 27 2021 at 15:13)</a>:</h4>
<p>maybe add <code>#[doc(module_prefixed)]</code>, allowing annotating those types that should show up in rustdoc (and rust-analyzer auto-complete) prefixed by their immediate parent module/crate?</p>



<a name="240483449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240483449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Conrad Ludgate <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240483449">(May 27 2021 at 15:15)</a>:</h4>
<p>I remember seeing a proposal about a 'canonical' doc path, so when you have re-exports you don't double up on documentation and it can show a better location. Could be similar</p>



<a name="240523544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240523544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240523544">(May 27 2021 at 20:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="222471">BurntSushi</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240472994">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240472362">said</a>:</p>
<blockquote>
<p>The biggest problem with module prefixed names is that tooling generally doesn't get it right as to when a type or function is "supposed" to be known about in a partly prefixed way.</p>
</blockquote>
<p>i either haven't experienced this or don't understand it. could you please give an example?</p>
</blockquote>
<p>I've seen this complaint before. As in, you're writing <code>io::Error</code> everywhere in your source but then you're debugging the application in <code>gdb</code> or using <code>Debug</code> or something to inspect it and you end up just seeing <code>Error</code> in the tool output and don't know what <code>Error</code> it is, because it doesn't know to prefix with the module.</p>



<a name="240523824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240523824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240523824">(May 27 2021 at 20:05)</a>:</h4>
<p>I vaguely recall this coming up in some conversation we had a while back, not sure what the context was other than that it was related to the prelude and <span class="user-mention" data-user-id="119235">@David Tolnay</span> recommended we only discourage reusing identifier names when the identifier is part of the prelude. So new types named <code>Error</code> are okay but new types named <code>Result</code> are discouraged.</p>



<a name="240528343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240528343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240528343">(May 27 2021 at 20:42)</a>:</h4>
<p>I would love to see an option to set the disambiguated name in rustdoc, such as in the parameters and return values of functions.</p>



<a name="240535320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240535320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240535320">(May 27 2021 at 21:37)</a>:</h4>
<p>The fully qualified path already is in the title attribute, i.e. you just have to hover over it</p>



<a name="240535928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240535928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240535928">(May 27 2021 at 21:42)</a>:</h4>
<p>True, but that's not as helpful for skimming.</p>



<a name="240536797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240536797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240536797">(May 27 2021 at 21:50)</a>:</h4>
<p>I guess it could scan the whole crate to see whether names are ambiguous and add path elements until they aren't.</p>



<a name="240536861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240536861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240536861">(May 27 2021 at 21:51)</a>:</h4>
<p>mhh, no it wouldn't be helpful if you're in the io module and it said io::Error because fmt::Error exists somewhere else</p>



<a name="240536961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240536961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240536961">(May 27 2021 at 21:52)</a>:</h4>
<p>maybe in other modules where there's no obvious preference</p>



<a name="240537019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240537019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240537019">(May 27 2021 at 21:52)</a>:</h4>
<p>I honestly <em>want</em> it to be spelled <code>io::Error</code> everywhere, even in the io module.</p>



<a name="240537057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240537057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240537057">(May 27 2021 at 21:53)</a>:</h4>
<p>I don't think rustdoc needs to do a scan and disambiguation. I'd be happy with an attr of some kind, either at the item level or the module level.</p>



<a name="240537098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240537098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240537098">(May 27 2021 at 21:53)</a>:</h4>
<p>"please include the module when referencing this name" or "please include the module when referencing any name from this module".</p>



<a name="240546395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240546395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240546395">(May 27 2021 at 23:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240523824">said</a>:</p>
<blockquote>
<p>So new types named <code>Error</code> are okay but new types named <code>Result</code> are discouraged.</p>
</blockquote>
<p>I'm pretty sure I read somewhere (rust book?) that it is common and recommended practice to locally define <code>type Result&lt;T&gt; = std::result::Result&lt;T, MyError&gt;</code>, and I think I'm not the only one who follows that style, so changing it to discouraged would probably be rather disruptive.</p>



<a name="240547233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240547233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240547233">(May 28 2021 at 00:05)</a>:</h4>
<p>It's probably better to do: <code>type Result&lt;T, E = MyError&gt; = core::result::Result&lt;T, E&gt;</code></p>



<a name="240554949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240554949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240554949">(May 28 2021 at 02:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="330154">The 8472</span> <a href="#narrow/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F/near/240535320">said</a>:</p>
<blockquote>
<p>The fully qualified path already is in the title attribute, i.e. you just have to hover over it</p>
</blockquote>
<p>Top of page isn't really the issue. It's every other part of the page where a type is used in a signature.</p>



<a name="240555770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Current%20thoughts%20on%20%22stuttering%22%20names%3F/near/240555770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Current.20thoughts.20on.20.22stuttering.22.20names.3F.html#240555770">(May 28 2021 at 02:40)</a>:</h4>
<p>hover works there too (note: title <em>attribute</em> on the html tag, not the title of the page)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>